getUserInfo();
//获取登陆用户详细信息
function getUserInfo() {
    $.ajax({
        url: "user",
        type: "get",
        success: function(data) {
            if (data.status == "1001") {
                var payload = eval("(" + data.list + ")");
                //用户姓名
                $("#fullName").html(payload.userinfoext.fullname);
                $("#userWelcome").html(payload.userinfoext.fullname + '，欢迎回来！');
                $("#userName").html(payload.userinfoext.fullname);
                //用户部门
                $("#userType").html(payload.userinfobase.unitname);

            }
        }
    });
}
getBookList();
//查询借阅信息
function getBookList() {
    $.ajax({
        url: 'library/BookCirculateList',
        type: "get",
        dataType: "json",
        cache: false,
        async: false,
        success: function(data) {
            if (data.status == "1001") {
                var data = eval("(" + data.list + ")");
                var len = data.booklist.books.length;
                $("#bookNum").html(len);
            }
        }
    });
}

getEmailList();
//获取未读邮件
function getEmailList() {
    $.ajax({
        url: 'mail/MailUnreadCnt',
        type: "get",
        dataType: "json",
        cache: false,
        async: false,
        success: function(data) {
            if (data.status == "1001") {
                var data = eval("(" + data.list + ")");
                var len = data.unread;
                $("#unreadEmail").html(len);
            }
        }
    });
}

getPimlist();
//获取办公信息
function getPimlist() {
    $.ajax({
        url: 'dcp/PimList',
        type: "get",
        dataType: "json",
        cache: false,
        async: false,
        success: function(data) {
            if (data.status == "1001") {
                var data = eval("(" + data.list + ")");
                var list = data.pimList.msg;
                var html = '';
                for (var i = 0; i < 4; i++) {
                    html +='<li><a href="javascript:;"><img src="assets/images/icon/u65.png">'+list[i].title+'</a></li>';
                }
                $("#pimContent").html(html);
            }
        }
    });
}






















//获取登录用户身份
function userType(type) {
    var type;
    type = Number(type);
    switch (type) {
        case 1:
            x = "全校师生";
            break;
        case 10:
            x = "双学位";
            break;
        case 11:
            x = "毕业生";
            break;
        case 12:
            x = "退休";
            break;
        case 13:
            x = "校聘合同制";
            break;
        case 14:
            x = "后勤合同制";
            break;
        case 15:
            x = "劳务派遣";
            break;
        case 16:
            x = "本科新生";
            break;
        case 17:
            x = "二学位新生";
            break;
        case 18:
            x = "研究生新生";
            break;
        case 2:
            x = "研究生";
            break;
        case 20:
            x = "员工";
            break;
        case 21:
            x = "博士新生";
            break;
        case 3:
            x = "在编教工";
            break;
        case 30:
            x = "在校生";
            break;
        case 4:
            x = "博士";
            break;
        case 40:
            x = "新生";
            break;
        case 5:
            x = "本科生";
            break;
        case 9:
            x = "高职";
            break;
        default:
            return;
    }
    return x;
}